
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@casual-simulation/crypto
Advanced tools
A common set of crypto helpers.
Defines a common interface for crypto implementations between web browsers and Node.js. (Currently only signing/verification and SHA-256 hashing is implemented)
npm install @casual-simulation/crypto
// ES6-style imports are required.
// If you are running in an environment that does not support ES Modules,
// then use Webpack or Babel to transpile to the format you want. (like CommonJS)
import { getHash, parsePublicPEMKey } from '@casual-simulation/crypto';
let myHash = getHash('Hello, World');
console.log('Hash: ', myHash);
// Hash: 03675ac53ff9cd1535ccc7dfcdfa2c458c5218371f418dc136f2d19ac1fbe8a5
let publicKeyPEM = `-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAryQICCl6NZ5gDKrnSztO
3Hy8PEUcuyvg/ikC+VcIo2SFFSf18a3IMYldIugqqqZCs4/4uVW3sbdLs/6PfgdX
7O9D22ZiFWHPYA2k2N744MNiCD1UE+tJyllUhSblK48bn+v1oZHCM0nYQ2NqUkvS
j+hwUU3RiWl7x3D2s9wSdNt7XUtW05a/FXehsPSiJfKvHJJnGOX0BgTvkLnkAOTd
OrUZ/wK69Dzu4IvrN4vs9Nes8vbwPa/ddZEzGR0cQMt0JBkhk9kU/qwqUseP1QRJ
5I1jR4g8aYPL/ke9K35PxZWuDp3U0UPAZ3PjFAh+5T+fc7gzCs9dPzSHloruU+gl
FQIDAQAB
-----END PUBLIC KEY-----`;
let publicKeyBytes = parsePublicPEMKey(publicKeyPEM);
console.log(publicKeyBytes.byteLength);
V0.10.0
webhook(options)
- options is an object that takes the following properties:
method
- The HTTP Method that should be used for the request.url
- The URL that the request should be made to.responseShout
- (Optional) The shout that should happen when a response is received from the server.headers
- (Optional) The HTTP headers that should be sent with the request.data
- (Optional) The data that should be sent with the request.webhook.post(url, data, options)
- Sends a HTTP Post request.
url
- The URL that the request should be made to.data
- (Optional) The data that should be sent with the request.options
- (Optional) An object that takes the following properties:
responseShout
- (Optional) The shout that should happen when a response is received from the server.headers
- (Optional) The headers that should be sent with the request.onWebhook()
action and send requests to https://auxplayer.com/{context}/{channel}/whatever-you-want
.
onWebhook()
is shouted to the channel that the request was made to and that
is an object with the following properties:
method
- The HTTP Method that the request was made with.url
- The URL that the request was made to.data
- The JSON data that the request included.headers
- The HTTP headers that were included with the request.onShout()
event.
onShout()
is executed on every bot whenever a shout or whisper happens.
that
is an object with the following properties:
name
is the name of the action being shouted.that
is the argument which was provided for the shout.targets
is an array of bots that the shout was sent to.listeners
is an array of bots that ran a script for the shout.responses
is an array of responses that were returned from the listeners.onChannelSubscribed()
- happens the first time a channel is loaded. Sent to every channel that is currently loaded.onChannelUnsubscribed()
- happens when a channel is unloaded. Sent to every channel that remains after the channel is unloaded.onChannelStreaming()
- happens when a channel is connected and fully synced. Sent to every channel that is currently loaded.onChannelStreamLost()
- happens when a channel is disconnected and may not be fully synced. Sent to every channel that is currently loaded.that
is an object with the following properties:
channel
- The channel that the event is for.onConnected()
onDisconnected()
aux.context.inventory.pannable
enables and disables the inventory's ability to pan, off by default.aux.context.inventory.resizable
enables and disables the inventory's drag to resize functionality, on by default.aux.context.inventory.rotatable
enables and disables the inventory's ability to rotate, on by default.aux.context.inventory.zoomable
enables and disables the inventory's ability to zoom, on by default.FAQs
Crypto helpers used by AUX
The npm package @casual-simulation/crypto receives a total of 6 weekly downloads. As such, @casual-simulation/crypto popularity was classified as not popular.
We found that @casual-simulation/crypto demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.