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');
 | 
					            this.trigger('back');
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        splitKey: function(key) {
 | 
					        splitKey: function(key) {
 | 
				
			||||||
            // key is a binary string
 | 
					            // key is an array buffer
 | 
				
			||||||
            return _.map(key, function(chr, i) {
 | 
					            var bytes = new Uint8Array(key);
 | 
				
			||||||
                return ('0' + key.charCodeAt(i).toString(16)).slice(-2);
 | 
					            var octets = [];
 | 
				
			||||||
 | 
					            for (var i = 0; i < bytes.byteLength; ++i) {
 | 
				
			||||||
 | 
					                octets.push(('0' + bytes[i].toString(16)).slice(-2));
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            });
 | 
					            return octets;
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        render_attributes: function() {
 | 
					        render_attributes: function() {
 | 
				
			||||||
            return {
 | 
					            return {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue