mirror of
https://github.com/hkalexling/Mango.git
synced 2026-03-20 00:00:48 -04:00
Finish the API endpoint for cover upload
This commit is contained in:
@@ -2,6 +2,7 @@ require "sqlite3"
|
||||
require "crypto/bcrypt"
|
||||
require "uuid"
|
||||
require "base64"
|
||||
require "./util"
|
||||
|
||||
def hash_password(pw)
|
||||
Crypto::Bcrypt::Password.create(pw).to_s
|
||||
@@ -11,10 +12,6 @@ def verify_password(hash, pw)
|
||||
(Crypto::Bcrypt::Password.new hash).verify pw
|
||||
end
|
||||
|
||||
def random_str
|
||||
UUID.random.to_s.gsub "-", ""
|
||||
end
|
||||
|
||||
class Storage
|
||||
def initialize(@path : String, @logger : Logger)
|
||||
dir = File.dirname path
|
||||
|
||||
Reference in New Issue
Block a user