Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More efficient seed handling #5

Open
Fasguy opened this issue Aug 6, 2022 · 0 comments
Open

More efficient seed handling #5

Fasguy opened this issue Aug 6, 2022 · 0 comments
Labels
Crafting-Recipe Randomizer This is for the Crafting-Recipe Randomizer enhancement New feature or request Loot-Table Randomizer This is for the Loot-Table Randomizer low priority This can be done whenever
Milestone

Comments

@Fasguy
Copy link
Owner

Fasguy commented Aug 6, 2022

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.

@Fasguy Fasguy added enhancement New feature or request help wanted Extra attention is needed low priority This can be done whenever General This is for the WebApp itself Loot-Table Randomizer This is for the Loot-Table Randomizer Crafting-Recipe Randomizer This is for the Crafting-Recipe Randomizer and removed General This is for the WebApp itself labels Aug 6, 2022
@Fasguy Fasguy changed the title Find solution for the seed input to support the full number range More efficient seed handling Aug 13, 2022
@Fasguy Fasguy added this to the Future milestone Mar 30, 2023
Fasguy added a commit that referenced this issue Aug 6, 2023
* Seeds are now generated using BigInt, to provide a 64 bit range

(addresses #5)
Fasguy added a commit that referenced this issue Dec 6, 2023
commit ddec67d894985516aabc8fc608cd339ff99684f5
Author: Fabian <9297451+Fasguy@users.noreply.github.com>
Date:   Thu Aug 17 19:40:39 2023 +0200

    Update package-lock.json

commit 840fe845236b696c362b25baa522d9241ceec65c
Author: Fabian <9297451+Fasguy@users.noreply.github.com>
Date:   Sun Aug 13 12:25:25 2023 +0200

    Changelog adjustment

commit 4ead6c13306a36134c01c1611806b65578b84a47
Author: Fabian <9297451+Fasguy@users.noreply.github.com>
Date:   Sun Aug 13 12:24:32 2023 +0200

    Instruction images

commit b3189ba7dd1d9e9b6a6039147652806782eb9d5e
Merge: 49e5f9e 32f844c
Author: Fabian <9297451+Fasguy@users.noreply.github.com>
Date:   Sun Aug 13 08:01:47 2023 +0200

    Merge branch 'trunk' into dev

commit 49e5f9e
Author: Fabian <9297451+Fasguy@users.noreply.github.com>
Date:   Sun Aug 6 15:05:23 2023 +0200

    Update changelog.json

commit 91d4b4a
Author: Fabian <9297451+Fasguy@users.noreply.github.com>
Date:   Sun Aug 6 14:37:49 2023 +0200

    Update changelog.json

commit 3ac9742
Author: Fabian <9297451+Fasguy@users.noreply.github.com>
Date:   Sun Aug 6 14:28:32 2023 +0200

    Changelog and version updated

commit 126e68d
Author: Fabian <9297451+Fasguy@users.noreply.github.com>
Date:   Sun Aug 6 14:21:10 2023 +0200

    Fix Firefox deadlock

    * In certain circumstances, reading from ReadableStreamDefaultReader causes a deadlock in Firefox. Causing a bit of delay seems to prevent the issue.

    (addresses #47)

commit 9017fd8
Author: Fabian <9297451+Fasguy@users.noreply.github.com>
Date:   Sun Aug 6 10:12:00 2023 +0200

    Seed adjustments

    * Seeds are now generated using BigInt, to provide a 64 bit range

    (addresses #5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Crafting-Recipe Randomizer This is for the Crafting-Recipe Randomizer enhancement New feature or request Loot-Table Randomizer This is for the Loot-Table Randomizer low priority This can be done whenever
Projects
Status: Todo
Development

No branches or pull requests

1 participant