Skip to content

Add sha256 function #1327

@jacqueswww

Description

@jacqueswww

Simple Summary

Currently Vyper doesn't

Abstract

Add sha256 function, which hcalls

Motivation

Currently sha256 precompile isn't exposed as a function, this VIP adds the functionality.

Specification

def sha256(bytelike: string) -> bytes32:
      # bytelike can be one of  byte_literal, str_literal, bytes, string, bytes32
      # ...

This function will make a call to the pre-compile at address 0x000...0002, and return the output as bytes.

Backwards Compatibility

Feature, forwards compatible.

Dependencies

No dependencies.

Copyright

Copyright and related rights waived via CC0

Metadata

Metadata

Assignees

No one assigned

    Labels

    VIP: ApprovedVIP ApprovedVIP: DiscussionUsed to denote VIPs and more complex issues that are waiting discussion in a meeting

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions