Skip to content

How can I encode a seed as JSON? #17

@ChrisPenner

Description

@ChrisPenner

Hey there! Hope you're doing well! I'm building a browser game where many clients are synced up and I need to share seeds amongst clients;

I can get a Random.Seed into elm no problem by using Random.initialSeed; but once I have a seed I can't serialize it back into JSON; Is there any way to encode a Seed? I simply need either a Random.Seed -> Int or a Random.Seed -> Json.Encode.Value

Does this exist; or would it be possible to add? I'm a bit stuck on this one 😬

Thanks for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions