-
Notifications
You must be signed in to change notification settings - Fork 0
ShortCode
uupaa edited this page Apr 20, 2015
·
3 revisions
-
create new Uint8Array view
source.subarray(begin, end)
-
Uint8Array to Array
Array.prototype.slice.call(source);
Array.prototype.slice.call(source.subarray(begin, end));
-
Uint8Array to String
String.fromCharCode.apply(null, source);
String.fromCharCode.apply(null, source.subarray(begin, end));
-
Array to Uint8Array
new Uint8Array(source);
new Uint8Array(source.slice(begin, end));
-
String to UTF8String
unescape( encodeURIComponent(source) );
unescape( encodeURIComponent(source.slice(begin, end)) );
-
UTF8String to String
decodeURIComponent( escape(source) );
decodeURIComponent( escape(source.slice(begin, end)) );