@@ -68,7 +68,7 @@ defmodule Scenic.Cache.Hash do
68
68
Returns the hash wrapped in a `{:ok, hash}` tuple.
69
69
"""
70
70
@ spec binary ( data :: binary , type :: hash_type ) ::
71
- { :ok , bitstring ( ) } | { :error , :invalid_hash_type }
71
+ { :ok , bitstring ( ) } | { :error , :invalid_hash_type }
72
72
def binary ( data , type ) do
73
73
case valid_hash_type? ( type ) do
74
74
true -> { :ok , type |> :crypto . hash ( data ) |> Base . url_encode64 ( padding: false ) }
@@ -90,7 +90,7 @@ defmodule Scenic.Cache.Hash do
90
90
91
91
# --------------------------------------------------------
92
92
@ spec file ( path :: bitstring , type :: hash_type ) ::
93
- { :ok , bitstring ( ) } | { :error , :invalid_hash_type }
93
+ { :ok , bitstring ( ) } | { :error , :invalid_hash_type }
94
94
def file ( path , hash_type ) do
95
95
do_compute_file (
96
96
path ,
@@ -148,7 +148,7 @@ defmodule Scenic.Cache.Hash do
148
148
If it fails, returns `{:error, :hash_failure}`
149
149
"""
150
150
@ spec verify ( data :: binary , hash :: bitstring , type :: hash_type ) ::
151
- { :ok , binary } | { :error , :hash_failure }
151
+ { :ok , binary } | { :error , :hash_failure }
152
152
def verify ( data , hash , hash_type ) do
153
153
case binary ( data , hash_type ) do
154
154
{ :ok , ^ hash } -> { :ok , data }
0 commit comments