Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
algebra-cyclic
Advanced tools
Readme
creates a space isomorphic to Zp: the cyclic ring of order p, where p is prime
Installation | API | Examples | License
{:.responsive}
With npm do
npm install algebra-cyclic
algebraCyclic(elements)
{Array|String}
elements{Object}
cyclic ringalgebraCyclic.error
An object exposing the following error messages:
All code in the examples below is intended to be contained into a single file.
var algebraCyclic = require('algebra-cyclic')
// Cyclic ring of vowels.
var vowel = algebraCyclic('aeiou')
vowel.contains('a') // true
vowel.contains('e') // true
vowel.contains('i') // true
vowel.contains('o') // true
vowel.contains('u') // true
vowel.contains('0') // false
vowel.contains('1') // false
vowel.contains('2') // false
vowel.contains('*') // false
vowel.addition('a', 'a') // 'a'
vowel.addition('a', 'e') // 'e'
vowel.addition('a', 'i') // 'i'
vowel.addition('a', 'o') // 'o'
vowel.addition('a', 'u') // 'u'
vowel.addition('e', 'e') // 'i'
vowel.addition('e', 'i') // 'o'
vowel.addition('e', 'o') // 'u'
vowel.addition('i', 'i') // 'u'
vowel.addition('i', 'o') // 'a'
vowel.addition('i', 'u') // 'e'
vowel.addition('o', 'o') // 'e'
vowel.addition('o', 'u') // 'i'
vowel.addition('u', 'u') // 'o'
vowel.subtraction('a', 'a') // 'a'
vowel.subtraction('a', 'e') // 'u'
vowel.subtraction('a', 'i') // 'o'
vowel.subtraction('a', 'o') // 'i'
vowel.subtraction('a', 'u') // 'e'
vowel.subtraction('e', 'e') // 'a'
vowel.subtraction('e', 'i') // 'u'
vowel.subtraction('e', 'o') // 'o'
vowel.subtraction('e', 'u') // 'i'
vowel.subtraction('i', 'i') // 'a'
vowel.subtraction('i', 'o') // 'u'
vowel.subtraction('i', 'u') // 'o'
vowel.subtraction('o', 'o') // 'a'
vowel.subtraction('o', 'u') // 'u'
vowel.subtraction('u', 'u') // 'a'
vowel.negation('a') // 'a'
vowel.negation('e') // 'u'
vowel.negation('i') // 'o'
vowel.negation('o') // 'i'
vowel.negation('u') // 'e'
// 'a' is considered as zero, and the following operation should throws
// cannotDivideByZero
vowel.inversion('a') // 'e'
vowel.inversion('e') // 'e'
vowel.inversion('i') // 'o'
vowel.inversion('o') // 'i'
vowel.inversion('u') // 'u'
// TODO complete operations (multiplication and divison)
The number of elements must be prime, and elements are required to be unique. The following snippets will throw.
// numberOfElementsIsNotPrime
algebraCyclic(['length', 'of', 'this', 'is', 'not', 'prime'])
// elementsAreNotUnique
algebraCyclic([1, 2, 1])
FAQs
creates a space isomorphic to Zp: the cyclic ring of order p, where p is prime
The npm package algebra-cyclic receives a total of 9 weekly downloads. As such, algebra-cyclic popularity was classified as not popular.
We found that algebra-cyclic demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.