5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-05 19:59:43 +08:00
wails/v3/examples/plugins/hashes
2024-04-14 21:41:33 +10:00
..
plugin.go Major plugin updates 2024-04-14 21:41:33 +10:00
plugin.toml Major plugin updates 2024-04-14 21:41:33 +10:00
README.md Major plugin updates 2024-04-14 21:41:33 +10:00

Hashes Plugin

This example plugin provides a way to generate hashes of strings.

Usage

Add the plugin to the Plugins option in the Applications options:

    Plugins: map[string]application.Plugin{
        "hashes": hashes.NewPlugin(),
    },

You can then call the Generate method from the frontend:

    import {Call} from "/wails/runtime.js";
    Call.Plugin("hashes","Generate","hello world").then((result) => console.log(result))

This method returns a struct with the following fields:

    interface Hashes {
        md5: string;
        sha1: string;
        sha256: string;
    }

A TypeScript definition file is provided for this interface.