Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- seed('2147483647');
- function seed(str) {
- // Minecraft Seed
- var x = str.charCodeAt(0)*31 + str.charCodeAt(1)||str.charCodeAt(0)||Math.floor((Math.random()-0.5)*4294967296);
- for (i = 1;i < str.length-1; i++) {
- x = x*31 + str.charCodeAt(i+1);
- }
- return (/\d/.test(str))?(Number(str)>2147483646)?Number(str)-4294967295:Number(str):(x>2147483646)?x-4294967295:x;
- }
Advertisement
Add Comment
Please, Sign In to add comment