COMPAS
  • Home
  • Docs
  • Extensions
  • Examples
  • Contribute
  • 1.17.9
  1. docs
  2. API Reference
  3. compas
  4. robots
  5. Link

Link.sha256

Link.sha256(as_string=False)[source]

Compute a hash of the data for comparison during version control using the sha256 algorithm.

Parameters

as_string (bool, optional) – If True, return the digest in hexadecimal format rather than as bytes.

Returns

bytes | str

Examples

>>> from compas.datastructures import Mesh
>>> mesh = Mesh.from_obj(compas.get('faces.obj'))
>>> v1 = mesh.sha256()
>>> v2 = mesh.sha256()
>>> mesh.vertex_attribute(mesh.vertex_sample(1)[0], 'z', 1)
>>> v3 = mesh.sha256()
>>> v1 == v2
True
>>> v2 == v3
False
  • Introduction
  • Installation
  • Getting started
  • Tutorial
  • API Reference
    • compas
      • artists
      • colors
      • data
      • datastructures
      • files
      • geometry
      • numerical
      • plugins
      • robots
      • rpc
      • topology
      • utilities
    • compas_blender
    • compas_ghpython
    • compas_plotters
    • compas_rhino
  • Extension points
  • Developer Guide
  • Changelog
  • Releases
  • License
  • Citing
Previous
Link.from_jsonstring
Next
Link.to_data

COMPAS

A computational framework for collaboration and research in Architecture, Engineering, Fabrication, and Construction.

Copyright © 2017-2021 compas-dev