convert uint8 arrays to hex

This commit is contained in:
ansuz
2016-12-16 15:18:06 +01:00
parent c0d96fb10d
commit 2968488278

View File

@@ -240,6 +240,12 @@ define([
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) {
if (window.history && window.history.replaceState) {
if (!/^#/.test(hash)) { hash = '#' + hash; }