Files

33 lines
698 B
Markdown
Raw Permalink Normal View History

2023-03-19 09:13:05 +11: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:
```go
Plugins: map[string]application.Plugin{
"hashes": hashes.NewPlugin(),
},
```
You can then call the Generate method from the frontend:
```js
2024-04-11 20:43:13 +10:00
import {Call} from "/wails/runtime.js";
Call.Plugin("hashes","Generate","hello world").then((result) => console.log(result))
2023-03-19 09:13:05 +11:00
```
This method returns a struct with the following fields:
```typescript
interface Hashes {
md5: string;
sha1: string;
sha256: string;
}
```
A TypeScript definition file is provided for this interface.