GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Prepager/Arduino-KeyDB: Wrapper around EEPROM as a key storing database.

BranchesTags
Open more actions menu

Latest commit

 

History

8 Commits
8 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
keywords.txt
keywords.txt
 
 
library.properties
library.properties
 
 

Repository files navigation

Arduino - EEPROM Key Database

This library is a wrapper around EEPROM as a key storing database. The libraries initial purpose was to be used for RFID HEX ID storing and verification.

Methods

int KeyDB::count() Returns key count from storage.

void KeyDB::loadKeys() Loads keys from storage into array.

void KeyDB::saveKeys() Saves array keys to storage.

void KeyDB::addKey(String key) Adds key to array and storage.

void KeyDB::removeKey(String key) Removes key from array and shift indexes.

Because of heavy read/write actions when removing you must manually call KeyDB::saveKeys() to save changes.

bool KeyDB::keyExists(String key) Checks if key exists in array.

String KeyDB::keyLengthen(String key) Forces a key to a fixed defined length.

Variables

#define DB_KEY_MAX 12 The maximum amount of keys in the database.

#define DB_KEY_LENGTH 8 The char length of the key.

String KeyDB::keys[DB_KEY_MAX] = {""} The main array of keys.

Usage

BEFORE USE: The initial count must be set by doing: #include <EEPROM.h> & EEPROM.write(0, 0);

// Include the KeyDB file.
#include "KeyDB.h"

// Create a new KeyDB object.
KeyDB database;

void setup() {
    Serial.begin(9600);

    // Add new key to database.
    database.addKey("ABC12345");

    // Check if it exists in storage.
    if (database.keyExists("ABC12345"))
        Serial.println("Valid key!");
}

About

Wrapper around EEPROM as a key storing database.

Topics

arduinoarduino-librarydatabaseeeprom

Resources

Readme
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.