summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-08-22 13:44:57 +0200
committerRémi Verschelde <rverschelde@gmail.com>2019-08-22 13:44:57 +0200
commit7402fd2c56c1165c1b212590235a408750b36fa7 (patch)
tree353ed0f6daad6cba1352d42780c736a4a2b8b218
parent7978e9071b9b2e5056a6a4ef2ece44d7ea00b4fb (diff)
Revert "Feature: Add SHA256 for PoolByteArray"
This reverts commit e2c3bbabb0a12f58585bb441d91ee8882225b0ee. This was superseded by #29871 which adds more crypto features with a dedicated interface. Since this commit was never in a stable release (merged during 3.2 dev), we revert it to avoid having to deprecate it in favor of the Crypto API. See https://github.com/godotengine/godot/pull/31187#issuecomment-523377965
-rw-r--r--core/variant_call.cpp11
-rw-r--r--doc/classes/PoolByteArray.xml7
2 files changed, 0 insertions, 18 deletions
diff --git a/core/variant_call.cpp b/core/variant_call.cpp
index 02c6cd73d8..3ab1386b13 100644
--- a/core/variant_call.cpp
+++ b/core/variant_call.cpp
@@ -596,16 +596,6 @@ struct _VariantCall {
r_ret = decompressed;
}
- static void _call_PoolByteArray_sha256_string(Variant &r_ret, Variant &p_self, const Variant **p_args) {
- PoolByteArray *ba = reinterpret_cast<PoolByteArray *>(p_self._data._mem);
- PoolByteArray::Read r = ba->read();
- String s;
- unsigned char hash[32];
- CryptoCore::sha256((unsigned char *)r.ptr(), ba->size(), hash);
- s = String::hex_encode_buffer(hash, 32);
- r_ret = s;
- }
-
static void _call_PoolByteArray_hex_encode(Variant &r_ret, Variant &p_self, const Variant **p_args) {
PoolByteArray *ba = reinterpret_cast<PoolByteArray *>(p_self._data._mem);
PoolByteArray::Read r = ba->read();
@@ -1769,7 +1759,6 @@ void register_variant_methods() {
ADDFUNC0R(POOL_BYTE_ARRAY, STRING, PoolByteArray, get_string_from_ascii, varray());
ADDFUNC0R(POOL_BYTE_ARRAY, STRING, PoolByteArray, get_string_from_utf8, varray());
- ADDFUNC0R(POOL_BYTE_ARRAY, STRING, PoolByteArray, sha256_string, varray());
ADDFUNC0R(POOL_BYTE_ARRAY, STRING, PoolByteArray, hex_encode, varray());
ADDFUNC1R(POOL_BYTE_ARRAY, POOL_BYTE_ARRAY, PoolByteArray, compress, INT, "compression_mode", varray(0));
ADDFUNC2R(POOL_BYTE_ARRAY, POOL_BYTE_ARRAY, PoolByteArray, decompress, INT, "buffer_size", INT, "compression_mode", varray(0));
diff --git a/doc/classes/PoolByteArray.xml b/doc/classes/PoolByteArray.xml
index 08848e789b..4d741b9136 100644
--- a/doc/classes/PoolByteArray.xml
+++ b/doc/classes/PoolByteArray.xml
@@ -113,13 +113,6 @@
Changes the byte at the given index.
</description>
</method>
- <method name="sha256_string">
- <return type="String">
- </return>
- <description>
- Returns SHA-256 string of the PoolByteArray.
- </description>
- </method>
<method name="size">
<return type="int">
</return>