Skip to content

Instantly share code, notes, and snippets.

@justinribeiro
Created April 10, 2017 18:20
Show Gist options
  • Save justinribeiro/abe2acbf27370d578f634cb76d93470e to your computer and use it in GitHub Desktop.
Save justinribeiro/abe2acbf27370d578f634cb76d93470e to your computer and use it in GitHub Desktop.
Sometimes I just need an EddyStone UID for testing.

Eddystone UID generate

Sometimes when I'm testing, I just need an UID and I don't particularly care about the ID portion. This little alias generate based on any string really (though should be FQDN).

alias genEuid='generateEddystoneUID'
generateEddystoneUID() {
  echo -n $1 | sha256sum | cut -b-10 | tr -d \\n | xxd -pu | xargs -I{} printf '%s%s' {} `od -vAn -N6 -tx2 < /dev/urandom | tr -d ' '`
}

Usage

~ 
➜ genEuid justinribeiro.com                                   
65373765363530616464b11dc3de8f2b 

More Info

Eddystone-UID @ google/eddystone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment