LoginSignup
18
19

More than 5 years have passed since last update.

rubyでハッシュ(sha1)に変換する方法

Posted at

gemのインストールは不要。
そのまま次のように書けば変換可能。

sample.rb
require 'digest/sha1'
print Digest::SHA1.hexdigest('変換したい文字列');

このスクリプトを実行するとコマンドラインにハッシュ化した文字列が表示される。

18
19
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
18
19