Skip to content

Commit 3195133

Browse files
committed
add embedded computer documentation
1 parent bc4824c commit 3195133

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

docs/mods/embedded-computer.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
title: Embedded Computer
3+
---
4+
# Embedded Computer
5+
6+
The Embedded Computer mod adds the following blocks
7+
- Embedded Computer
8+
- Secure Computer
9+
10+
The Embedded Computer allows you to have a computer that has an unreadable drive.
11+
12+
The Secure Computer is an Embedded Computer with a terminal.
13+
14+
## Loading data onto the Embedded Computer
15+
You can load data onto your Embedded Computer by placing a disk drive next to it with a startup.lua file in it, that startup.lua file should have code that copies data to the Embedded Computer itself.
16+
17+
We suggest disabling disk startup and locking your embedded computer when your code starts in order to prevent malicious code from executing.
18+
19+
## API
20+
Every embedded computer has the following functions available:
21+
22+
`embedded.setPassword(string pass)` - old, aliases to security.lock. prior to 1.1.0 / 0.4.0 it was equivalent to security.lockInsecure
23+
24+
`security.lock(string pass)` - Adds a lock to the computer, uses SHA256 hashed many times then finally hashed with SHA512 several times. do NOT manually write to .LOCKED_HASHED if you want your stuff to work.
25+
26+
`security.lockHashed(string pass, string algo)` - like security.lock but you specify the algorithm. supports the following:
27+
28+
- `sha256` (recommended)
29+
- `murmur3`
30+
- `adler32`
31+
- `siphash24`
32+
33+
### `security` hash functions
34+
35+
`security.hashStrSHA512(string)`
36+
`security.hashStrSHA256(string)`
37+
`security.hashStrMurmur3(string)`
38+
`security.hashStrAdler32(string)`
39+
`security.hashStrSipHash24(string)`
40+
41+
### Embedded and Secure Computers' Peripheral API
42+
`embeddedComputer.isOn()`
43+
`embeddedComputer.getId()`
44+
`embeddedComputer.reboot()`
45+
`embeddedComputer.format()` - requires the computer to be unlocked to use. both the secure and insecure locks need to be removed
46+
`embeddedComputer.unlockPlainText(string password)` - removes the insecure lock
47+
`embeddedComputer.unlockHashed(string pass, string algo)` - removes the hashed lock, same args as security.lockHashed
48+
`embeddedComputer.unlock(string pass)` - alias to unlockHashed with SHA256. prior to 1.1.0 / 0.4.0 it was equivalent to embeddedComputer.unlockPlainText
49+
50+
### Hard drive API
51+
Please note, hard drives are made uncraftable by the server.
52+
53+
`hardDrive.mount(location)` - mounts the hard drive to any location on computer
54+
`hardDrive.unmount(location)` - unmounts the hard drive from this location

0 commit comments

Comments
 (0)