mirror of
https://github.com/shaka-project/shaka-player.git
synced 2026-06-14 15:56:38 +03:00
Add backward compatibility shim for exported util
This method (shaka.util.Uint8ArrayUtils.equal) was removed between v2.5.0 and v2.6, but could be in use by applications. This change adds the utility method back, with a deprecation warning. Change-Id: Ifd780759ae389e766c1889a83545cfda8969e76b
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
goog.provide('shaka.util.Uint8ArrayUtils');
|
||||
|
||||
goog.require('shaka.Deprecate');
|
||||
goog.require('shaka.util.BufferUtils');
|
||||
goog.require('shaka.util.Iterables');
|
||||
goog.require('shaka.util.StringUtils');
|
||||
@@ -15,6 +16,22 @@ goog.require('shaka.util.StringUtils');
|
||||
* @exportDoc
|
||||
*/
|
||||
shaka.util.Uint8ArrayUtils = class {
|
||||
/**
|
||||
* Compare two Uint8Arrays for equality.
|
||||
* @param {Uint8Array} arr1
|
||||
* @param {Uint8Array} arr2
|
||||
* @return {boolean}
|
||||
* @deprecated
|
||||
* @export
|
||||
*/
|
||||
static equal(arr1, arr2) {
|
||||
shaka.Deprecate.deprecateFeature(
|
||||
2, 7,
|
||||
'shaka.util.Uint8ArrayUtils.equal',
|
||||
'Please use shaka.util.BufferUtils.equal instead.');
|
||||
return shaka.util.BufferUtils.equal(arr1, arr2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a buffer to a base64 string. The output will be standard
|
||||
* alphabet as opposed to base64url safe alphabet.
|
||||
|
||||
Reference in New Issue
Block a user