Class: Black_matter

Inherits:
Object show all
Defined in:
lib/atome/kernel/black_matter.rb

Class Method Summary collapse

Class Method Details

.check_password(input_password, stored_hash) ⇒ Object



9
10
11
12
# File 'lib/atome/kernel/black_matter.rb', line 9

def check_password(input_password, stored_hash)
  input_hash = encode(input_password)
  input_hash == stored_hash
end

.encode(string) ⇒ Object



4
5
6
7
# File 'lib/atome/kernel/black_matter.rb', line 4

def encode(string)
  string=string.to_s
  JS.global.sha256(string.to_s)
end

.passwordObject



18
19
20
# File 'lib/atome/kernel/black_matter.rb', line 18

def password
  @password
end

.set_password(hashed_pass) ⇒ Object



14
15
16
# File 'lib/atome/kernel/black_matter.rb', line 14

def set_password(hashed_pass)
  @password = hashed_pass
end