Skip to main content

Robot Framework library that generates hashes based on the given input

Project description

HashLibrary for Robot Framework®

HashLibrary is a library for Robot Framework that provides methods to generate various hashes from strings and files. It supports base64, crc32, md5, and sha256 hashes.


Installation

If you already have Python >= 3.8 with pip installed, you can simply run:

pip install robotframework-hashlibrary

Getting started

Here are some examples of how to import and use the library.

Importing the Library

*** Settings ***
Library            HashLibrary

Variables

*** Variables ***
${TEST_STRING}    david
${TEST_FILE}      path/to/file.txt

Test Cases

Generate Base64 Hash for String

*** Test Cases ***
Generate Base64 Hash for String
    ${hash}    Get Base64 Hash From String    ${TEST_STRING}
    Should Be Equal    ${hash}    ZGF2aWQ=

Generate CRC32 Hash for String

*** Test Cases ***
Generate CRC32 Hash for String
    ${hash}    Get Crc32 Hash From String    ${TEST_STRING}
    Should Be Equal    ${hash}    0x8796d7bb

Generate MD5 Hash for String

*** Test Cases ***
Generate MD5 Hash for String
    ${hash}    Get md5 Hash From String    ${TEST_STRING}
    Should Be Equal    ${hash}    172522ec1028ab781d9dfd17eaca4427

Generate SHA256 Hash for File

*** Test Cases ***
Generate SHA256 Hash for File
    ${hash}    Get Sha256 Hash From File    ${TEST_FILE}
    Should Be Equal    ${hash}    <expected_sha256_hash>

Generate Base64 Hash for File

*** Test Cases ***
Generate Base64 Hash for File
    ${hash}    Get Base64 Hash From File    ${TEST_FILE}
    Should Be Equal    ${hash}    <expected_base64_hash>

Generate CRC32 Hash for File

*** Test Cases ***
Generate CRC32 Hash for File
    ${hash}    Get Crc32 Hash From File    ${TEST_FILE}
    Should Be Equal    ${hash}    <expected_crc32_hash>

Generate MD5 Hash for File

*** Test Cases ***
Generate MD5 Hash for File
    ${hash}    Get md5 Hash From File    ${TEST_FILE}
    Should Be Equal    ${hash}    <expected_md5_hash>

Contributing

If you would like to contribute to this project, please fork the repository and submit a pull request. We welcome all contributions!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

robotframework_hashlibrary-0.4.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

robotframework_hashlibrary-0.4-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file robotframework_hashlibrary-0.4.tar.gz.

File metadata

File hashes

Hashes for robotframework_hashlibrary-0.4.tar.gz
Algorithm Hash digest
SHA256 91e8cb742e0a6e2a4afc920ec311a1e2a2ec0622abe036baf05f973563632a2f
MD5 08fc85de0e929eb5414713c001f16cc3
BLAKE2b-256 7da44d50b11b5cade24d23e54b15a119f0ede24bc0f8d67bf74c30fbfbad1eae

See more details on using hashes here.

File details

Details for the file robotframework_hashlibrary-0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for robotframework_hashlibrary-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e106b2831f3587a4613a308ef30291fa4f47ed5a10c34ddbf2cc969c97d55c64
MD5 a548aba53044c17226e0630e31185ab1
BLAKE2b-256 833ac6cc9e077f95a8e25a86c4b7a768b80ede5ce3abba7051915942df4e6632

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page