convert uint8 arrays to hex

pull/1/head
ansuz 8 years ago
parent c0d96fb10d
commit 2968488278

@ -240,6 +240,12 @@ define([
return secret; return secret;
}; };
var uint8ArrayToHex = common.uint8ArrayToHex = function (a) {
return a.map(function (e) {
return Number(e & 0xff).toString(16);
}).join('');
};
var replaceHash = common.replaceHash = function (hash) { var replaceHash = common.replaceHash = function (hash) {
if (window.history && window.history.replaceState) { if (window.history && window.history.replaceState) {
if (!/^#/.test(hash)) { hash = '#' + hash; } if (!/^#/.test(hash)) { hash = '#' + hash; }

Loading…
Cancel
Save