lib/platform_specific/opal/extensions/sha.rb in atome-0.5.6.1.4 vs lib/platform_specific/opal/extensions/sha.rb in atome-0.5.6.1.9
- old
+ new
@@ -1,14 +1,25 @@
-# frozen_string_literal: true
-
-# addon for the Atome class
-class Atome
- def calculate_sha(string)
- if RUBY_ENGINE.downcase == 'opal' || 'wasm32-wasi'
- # `sha256(#{string})`
- js_code = "sha256('#{string}')"
- JS.eval(js_code)
- else
- Digest::SHA256.hexdigest(string)
- end
- end
-end
+# # frozen_string_literal: true
+#
+# # # addon for the Atome class
+# class Atome
+# # def calculate_sha(string)
+# # if RUBY_ENGINE.downcase == 'opal' || 'wasm32-wasi'
+# # # `sha256(#{string})`
+# # js_code = "sha256('#{string}')"
+# # JS.eval(js_code)
+# # else
+# # Digest::SHA256.hexdigest(string)
+# # end
+# # end
+# #
+# #
+# def crypt(string)
+# # if RUBY_ENGINE.downcase == 'opal' || 'wasm32-wasi'
+# # `sha256(#{string})`
+# js_code = "sha256('#{string}')"
+# JS.eval(js_code)
+# # else
+# Digest::SHA256.hexdigest(string)
+# # end
+# end
+# end