Skip to content

Instantly share code, notes, and snippets.

@karmatr0n
Created October 30, 2023 02:52
Show Gist options
  • Save karmatr0n/0322bed770b82dc25ce450c6393f2307 to your computer and use it in GitHub Desktop.
Save karmatr0n/0322bed770b82dc25ce450c6393f2307 to your computer and use it in GitHub Desktop.
Generate random string
require 'securerandom'
SecureRandom.base64(28).slice(0,26).gsub(/(\+|\/)/,("a".."z").to_a.
sample)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment