More efficient seed handling #5

Open
opened 2022-08-06 16:37:36 +02:00 by Ghost · 0 comments
Ghost commented 2022-08-06 16:37:36 +02:00 (Migrated from git.fasguy.net)

JavaScript provides 53 integer-safe bits for numbers, which can be fully utilized with a custom number input. A string input however only provides a 32 bit hash with the current hashing implementation. Utilizing all 53 bits reduces the chance of collisions. It may be worth looking into cyrb53 (https://github.com/bryc/code/blob/master/jshash/experimental/cyrb53.js) for this.

This will be a big breaking change and will cause old string-based seeds to no longer produce the same output


Original title: Find solution for the seed input to support the full number range

Original Description: JavaScript provides 53 bits of integer-safety, this is not enough, if i want to emulate how Minecraft handles seed inputs.
A point of interest might be BigInt, but i don't think that this is suitable for inputting seeds.

JavaScript provides 53 integer-safe bits for numbers, which can be fully utilized with a custom number input. A string input however only provides a 32 bit hash with the current hashing implementation. Utilizing all 53 bits reduces the chance of collisions. It may be worth looking into cyrb53 (https://github.com/bryc/code/blob/master/jshash/experimental/cyrb53.js) for this. **This will be a big breaking change and will cause old string-based seeds to no longer produce the same output** --- **Original title**: ~~Find solution for the seed input to support the full number range~~ **Original Description**: ~~JavaScript provides 53 bits of integer-safety, this is not enough, if i want to emulate how Minecraft handles seed inputs. A point of interest might be BigInt, but i don't think that this is suitable for inputting seeds.~~
Sign in to join this conversation.
No description provided.