Skip to content

Instantly share code, notes, and snippets.

@appkr
Last active April 16, 2019 14:35
Show Gist options
  • Select an option

  • Save appkr/f9ae88f7edc4c14c4c0b9f49fec78bf2 to your computer and use it in GitHub Desktop.

Select an option

Save appkr/f9ae88f7edc4c14c4c0b9f49fec78bf2 to your computer and use it in GitHub Desktop.
UUID, Random String Generate
import java.util.UUID;
UUID.randomUUID();
Integer.parseInt("8654", 16);
// psysh in your shell
// @see https://github.com/appkr/dotfiles/commit/7651951140c51cbb6b83e588a799c2eb2ce6f9d3
use Ramsey\Uuid\Uuid;
(string)Uuid::uuid4();
(int)0x8654;
str_random(30);
# "python" in your shell
import uuid
uuid.uuid4()
int(0x8654)
# "irb" in your shell
require 'securerandom'
uuid = SecureRandom.uuid
0x8654.to_i
SecureRandom.alphanumeric(30)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment