<div> </div> <div>이런 분야는 </div> <div> </div> <div>완전 무지해서 질문이 이상해도 양해부탁드립니다 ㅠㅠ</div> <div> </div> <div> </div> <div> </div> <div>//the seed pair itself<br> var clientSeed = "your client seed"; //dont forget to exclude the dash and the nonce!<br> var serverSeed = "your server seed";<br><br> //bet made with seed pair (excluding current bet)<br> var nonce = 0;<br><br> //crypto lib for hmac function<br> var crypto = require('crypto');<br><br> var roll = function(key, text) {<br><br> //create HMAC using server seed as key and client seed as message<br> var hash = crypto.createHmac('sha512', key).update(text).digest('hex');<br><br> var index = 0;<br><br> var lucky = parseInt(hash.substring(index * 5, index * 5 + 5), 16);<br><br> //keep grabbing characters from the hash while greater than <br> while (lucky >= Math.pow(10, 6)) {<br> index++;<br> lucky = parseInt(hash.substring(index * 5, index * 5 + 5), 16);<br><br> //if we reach the end of the hash, just default to highest number<br> if (index * 5 + 5 > 128) {<br> lucky = 99.99;<br> break;<br> }<br> }<br><br> lucky %= Math.pow(10, 4);<br> lucky /= Math.pow(10, 2);<br><br> return lucky;<br> }<br> console.log(roll(serverSeed, clientSeed+'-'+nonce));</div> <div> </div> <div> </div> <div> </div> <div>그리고 중간에 Crypto라는 것은 뭐죠??</div> <div> </div> <div>그리고 중간중간 명령어(?)가 아닌, 말로 하는 설명들은 만약 구동한다면 지워줘야 하는건가요?</div> <div> </div>
댓글 분란 또는 분쟁 때문에 전체 댓글이 블라인드 처리되었습니다.