Let key verification view use array buffers
This commit is contained in:
parent
17a3025af2
commit
f6b5eec84e
1 changed files with 7 additions and 4 deletions
|
@ -27,11 +27,14 @@
|
|||
this.trigger('back');
|
||||
},
|
||||
splitKey: function(key) {
|
||||
// key is a binary string
|
||||
return _.map(key, function(chr, i) {
|
||||
return ('0' + key.charCodeAt(i).toString(16)).slice(-2);
|
||||
// key is an array buffer
|
||||
var bytes = new Uint8Array(key);
|
||||
var octets = [];
|
||||
for (var i = 0; i < bytes.byteLength; ++i) {
|
||||
octets.push(('0' + bytes[i].toString(16)).slice(-2));
|
||||
}
|
||||
|
||||
});
|
||||
return octets;
|
||||
},
|
||||
render_attributes: function() {
|
||||
return {
|
||||
|
|
Loading…
Reference in a new issue