Crate sp_core

source ·
Expand description

Shareable Substrate types.

Re-exports

Modules

  • VRFs backed by Bandersnatch, an elliptic curve built over BLS12-381 scalar field.
  • Traits, types and structs to support a bounded BTreeMap.
  • Traits, types and structs to support putting a bounded vector into storage, as a raw value, map or a double map.
  • Provides a const function for converting a hex string to a u8 array at compile time, when used in the proper context.
  • Cryptographic utilities.
  • Contains the crate::defer! macro for deferring the execution of code until the current scope is dropped. This helps with always executing cleanup code.
  • Simple ECDSA secp256k1 API.
  • Simple Ed25519 API.
  • A fixed hash type.
  • Wrapper type for byte collections that outputs hex.
  • Offchain workers types
  • API for using a pair of crypto schemes together.
  • Simple sr25519 (Schnorr-Ristretto) API.
  • Types that should only be used for testing!
  • Shareable Substrate traits.
  • An unsigned fixed-size integer.

Macros

Structs

  • Concrete implementation of Hasher using Blake2b 256-bit hashes
  • Hex-serialized shim for Vec<u8>.
  • Const getter for a basic type.
  • Const getter for a basic type.
  • Const getter for a basic type.
  • Const getter for a basic type.
  • Const getter for a basic type.
  • Const getter for a basic type.
  • Const getter for a basic type.
  • Const getter for a basic type.
  • Const getter for a basic type.
  • Const getter for a basic type.
  • Const getter for a basic type.
  • Implement Get by returning Default for any type that implements Default.
  • Fixed-size uninterpreted hash type with 20 bytes (160 bits) size.
  • Fixed-size uninterpreted hash type with 32 bytes (256 bits) size.
  • Fixed-size uninterpreted hash type with 64 bytes (512 bits) size.
  • Concrete implementation of Hasher using Keccak 256-bit hashes
  • Stores the encoded RuntimeMetadata for the native side as opaque type.
  • Simple blob to hold a PeerId without committing to its format.
  • Little-endian large integer type 256-bit unsigned integer.
  • Little-endian large integer type 512-bits unsigned integer.

Enums

  • A log level matching the one from log crate.
  • Log level filter that expresses which log levels should be filtered.
  • The void type - it cannot exist.

Constants

Traits

  • A trait for querying a single value from a type.
  • Trait describing an object that can hash a slice of bytes. Used to abstract other types over the hashing algorithm. Defines a single hash method and an Out associated type with the necessary bounds.
  • Try and collect into a collection C.
  • Provide a simple 4 byte identifier for a type.
  • A trait for querying a single value from a type defined in the trait.

Functions

  • Do a Blake2 64-bit hash and return result.
  • Do a Blake2 128-bit hash and return result.
  • Do a Blake2 256-bit hash and return result.
  • Do a Blake2 512-bit hash and return result.
  • Do a Blake2 512-bit hash and place result in dest.
  • Do a keccak 256-bit hash and return result.
  • Do a keccak 512-bit hash and return result.
  • Do a sha2 256-bit hash and return result.
  • Do a XX 64-bit hash and return result.
  • Do a XX 64-bit hash and place result in dest.
  • Do a XX 128-bit hash and return result.
  • Do a XX 128-bit hash and place result in dest.
  • Do a XX 256-bit hash and return result.
  • Do a XX 256-bit hash and place result in dest.

Derive Macros