diff options
| author | Bojidar Marinov | 2016-06-17 10:55:16 +0300 |
|---|---|---|
| committer | Bojidar Marinov | 2016-06-17 10:55:16 +0300 |
| commit | 7073bb0bb2c814b71f6128d249d7135dfca94b4a (patch) | |
| tree | 41015e5af4288ffc3e4cc83826f5c883d2498de6 /core/bind | |
| parent | 367aabf03080da8e4e72c9db56b0b2097c86d6b4 (diff) | |
| download | godot-7073bb0bb2c814b71f6128d249d7135dfca94b4a.tar.gz godot-7073bb0bb2c814b71f6128d249d7135dfca94b4a.tar.zst godot-7073bb0bb2c814b71f6128d249d7135dfca94b4a.zip | |
Add sha256 to String and File/FileAccess.
Probably does #4166
Diffstat (limited to 'core/bind')
| -rw-r--r-- | core/bind/core_bind.cpp | 7 | ||||
| -rw-r--r-- | core/bind/core_bind.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 31c0c0e20..3cdefc581 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -1558,6 +1558,12 @@ String _File::get_md5(const String& p_path) const { } +String _File::get_sha256(const String& p_path) const { + + return FileAccess::get_sha256(p_path); + +} + String _File::get_line() const{ @@ -1748,6 +1754,7 @@ void _File::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_line"),&_File::get_line); ObjectTypeDB::bind_method(_MD("get_as_text"),&_File::get_as_text); ObjectTypeDB::bind_method(_MD("get_md5","path"),&_File::get_md5); + ObjectTypeDB::bind_method(_MD("get_sha256","path"),&_File::get_md5); ObjectTypeDB::bind_method(_MD("get_endian_swap"),&_File::get_endian_swap); ObjectTypeDB::bind_method(_MD("set_endian_swap","enable"),&_File::set_endian_swap); ObjectTypeDB::bind_method(_MD("get_error:Error"),&_File::get_error); diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index 441927940..a48f7f111 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -380,6 +380,7 @@ public: String get_line() const; String get_as_text() const; String get_md5(const String& p_path) const; + String get_sha256(const String& p_path) const; /**< use this for files WRITTEN in _big_ endian machines (ie, amiga/mac) * It's not about the current CPU type but file formats. |
