xsubtle

package
v0.13.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 29, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package xsubtle provides functions and utilities to extend Go's default crypto/subtle package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstantTimeStringEqual

func ConstantTimeStringEqual(given, actual string) bool

ConstantTimeStringEqual performs a constant-time comparison of two strings to prevent timing attacks. It returns true if the strings are equal, false otherwise. The comparison time depends only on the length of the strings and not their contents.

This function is intended for comparing sensitive strings like passwords or authentication tokens. For regular string comparison, use the == operator.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL