Skip to content

Long character strings to char2seed() always make a seed of 0 #5

@andrewheiss

Description

@andrewheiss

With codename v0.5.0 (and maybe before?), strings that are longer than 9 alphanumeric characters result in the same seed: 0:

library(codename)

char2seed("My project title is really long")
#> Warning in char2seed("My project title is really long"): probable complete loss
#> of accuracy in modulus
#> [1] 0
char2seed("Here's another really long seed")
#> Warning in char2seed("Here's another really long seed"): probable complete loss
#> of accuracy in modulus
#> [1] 0

codename(type = "ubuntu", "My project title is really long")
#> Warning in char2seed(seed): probable complete loss of accuracy in modulus
#> [1] "sapphire stoat"
codename(type = "ubuntu", "Here's another really long seed")
#> Warning in char2seed(seed): probable complete loss of accuracy in modulus
#> [1] "sapphire stoat"

The documentation for char2seed() currently says

The function may warn of "loss of accuracy", but this just means you supplied it a really long character vector.

But in practice that "loss of accuracy" warning means that the really long character vector will always generate a seed of 0.

I don't know what to do about it though :( so I've just been making sure my character seeds stay at ≤9 characters

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions