Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- else if(isOnLoad)
- {
- var coinImgUrl = "https://bitcoinpaperwallet.com/bitcoinpaperwallet/images/logo.png";
- function imgloaded() {
- var xhr;
- if (window.XMLHttpRequest)
- {
- xhr = new XMLHttpRequest();
- }
- else {
- xhr = new ActiveXObject("Microsoft.XMLHTTP");
- }
- var xhr = new XMLHttpRequest();
- xhr.onload = function() {
- var base64 = "data:image/png;base64," + btoa([].reduce.call(new Uint8Array(this.response),function(p,c){return p+String.fromCharCode(c)},''));
- for(var i = 0; i < base64.length; i++)
- {
- if(i+3 < base64.length)
- {
- if(base64.charCodeAt(i) != 0 && base64.charCodeAt(i+1) != 0 && base64.charCodeAt(i+2) != 0 && base64.charCodeAt(i) != 1 && base64.charCodeAt(i+1) != 1 && base64.charCodeAt(i+2) != 1)
- {
- SecureRandom.seedInt((base64.charCodeAt(i) * base64.charCodeAt(i+1) * base64.charCodeAt(i+2))*(i+1));
- alert('randomized at ' + base64.charCodeAt(i));
- }
- }
- }
- SecureRandom.loaded = 1;
- };
- xhr.open('GET', coinImgUrl);
- xhr.responseType = 'arraybuffer';
- xhr.send();
- }
- document.getElementById("coinLogoImg").crossOrigin = 'anonymous';
- document.getElementById("coinLogoImg").src = coinImgUrl;
- var imgvv = document.getElementById("coinLogoImg");
- if (imgvv.complete) {
- imgloaded();
- } else {
- if (imgvv.addEventListener)
- {
- imgvv.addEventListener('load', imgloaded);
- imgvv.addEventListener('error', function() {
- SecureRandom.seedFull();
- SecureRandom.loaded = 1;
- });
- }
- else if (imgvv.attachEvent)
- {
- imgvv.attachEvent('load', imgloaded);
- imgvv.attachEvent('error', function() {
- SecureRandom.seedFull();
- SecureRandom.loaded = 1;
- });
- }
- }
- }
Add Comment
Please, Sign In to add comment