Skip to content

Commit b014ad7

Browse files
committed
rename
1 parent 51d1eb4 commit b014ad7

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
### Added
1212

1313
* Added `Polyline.extend`, `Polyline.extended`, `Polyline.shorten`, `Polyline.shortened`.
14-
* Added `Data.hash` for computing a hash value of data objects, for example for comparisons during version control.
14+
* Added `Data.sha256` for computing a hash value of data objects, for example for comparisons during version control.
1515

1616
### Changed
1717

src/compas/data/data.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,8 @@ def validate_json(self):
361361
raise e
362362
return jsonstring
363363

364-
def hash(self, as_string=False):
365-
"""Compute a hash of the data for comparison during version control.
364+
def sha256(self, as_string=False):
365+
"""Compute a hash of the data for comparison during version control using the sha256 algorithm.
366366
367367
Parameters
368368
----------
@@ -375,11 +375,12 @@ def hash(self, as_string=False):
375375
376376
Examples
377377
--------
378+
>>> from compas.datastructures import Mesh
378379
>>> mesh = Mesh.from_obj(compas.get('faces.obj'))
379-
>>> v1 = mesh.hash()
380-
>>> v2 = mesh.hash()
380+
>>> v1 = mesh.sha256()
381+
>>> v2 = mesh.sha256()
381382
>>> mesh.vertex_attribute(mesh.vertex_sample(1)[0], 'z', 1)
382-
>>> v3 = mesh.hash()
383+
>>> v3 = mesh.sha256()
383384
>>> v1 == v2
384385
True
385386
>>> v2 == v3

0 commit comments

Comments
 (0)